package com.itpeng.security;

import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;

/**
 * @Aythor:彭彦钦
 * @Data: 2020/9/27  16:43
 */
public class TestEncode {

    public static void main(String[] args) {
        BCryptPasswordEncoder encoder = new BCryptPasswordEncoder();
        System.out.println("加密后：" + encoder.encode("admin"));


        System.out.println("解密后：" + encoder.matches("admin", "$2a$10$ZG9bkGBiGyvdM69KS.weOuGNLfIOk2ty4gX9p16QlnY9Se0LJ1PyC"));
    }
}
